package com.tank.collision;

import com.almasb.fxgl.dsl.FXGL;
import com.almasb.fxgl.entity.Entity;
import com.almasb.fxgl.entity.SpawnData;
import com.almasb.fxgl.physics.CollisionHandler;
import com.tank.constant.GameType;

public class BulletBorderCollideHandler extends CollisionHandler {
    public BulletBorderCollideHandler() {
        super(GameType.BULLET, GameType.BORDER);
    }

    @Override
    protected void onCollisionBegin(Entity bullet, Entity border) {
        FXGL.spawn("silentExplosion", bullet.getCenter().subtract(50 / 2.0, 50 / 2.0));
        bullet.removeFromWorld();
    }
}
